package com.pasabahceambalaj.session;

import com.pasabahceambalaj.entity.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.Arrays;

@Name("firmaList")
public class FirmaList extends EntityQuery<Firma> {

	private static final String EJBQL = "select firma from Firma firma";

	private static final String[] RESTRICTIONS = { "lower(firma.ad) like lower(concat(#{firmaList.firma.ad},'%'))", "lower(firma.adres) like lower(concat(#{firmaList.firma.adres},'%'))", "lower(firma.eposta) like lower(concat(#{firmaList.firma.eposta},'%'))", "lower(firma.kod) like lower(concat(#{firmaList.firma.kod},'%'))", "lower(firma.telefon) like lower(concat(#{firmaList.firma.telefon},'%'))", "lower(firma.webadresi) like lower(concat(#{firmaList.firma.webadresi},'%'))", };

	private Firma firma = new Firma();

	public FirmaList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}

	public Firma getFirma() {
		return firma;
	}
}
